<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<style type="text/css">
			.content{
				width: 500px;
				height: 500px;
				margin: 30px auto;
				background-color: burlywood;
			}
			.item{
				width: 100px;
				line-height: 40px;
				background-color: rosybrown;
				text-align: center;
				float: left;
				margin: 5px;
			}
		</style>
	</head>
	<body>
		<div class="content">
			
		</div>
	</body>
	<script type="text/javascript">
//		获取元素
		var content = document.querySelector(".content");
		var arr = ["小明","大卫","李雷","二丫","狗蛋","张三","小明","大卫","李雷","二丫","狗蛋","张三","小明","大卫","李雷","二丫","狗蛋","张三"];
		
		function createStudent(i){
			var item = document.createElement("div");
			item.className = "item";
			item.innerText = arr[i];
			return item
		}

		for (var i=0;i<arr.length;i++) {
			var student = createStudent(i);
			content.appendChild(student);
		}
		
	</script>
</html>
